/*
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
 */

CKEDITOR.editorConfig = function(config) {
	// Define changes to default configuration here. For example:
	// config.language = 'fr';
	config.skin = 'v2';
	config.language = 'zh-cn';

	config.filebrowserBrowseUrl = 'resource.action?browser=true';
	config.filebrowserImageBrowseUrl = 'resource.action?browser=true&typeId=1';
	config.filebrowserFlashBrowseUrl = 'resource.action?browser=true&typeId=2';
	
	config.filebrowserWindowFeatures = 'location=no,menubar=no,toolbar=no,'
			+ 'dependent=yes,minimizable=yes,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes';
	config.tabSpaces = 4;
	
	config.enterMode = CKEDITOR.ENTER_BR;  
	config.shiftEnterMode = CKEDITOR.ENTER_P;
	
	config.contentsCss=['plugins/ckeditor/plugins/insertcode/dialogs/Styles/SyntaxHighlighter.css']; 
	
	config.width='100%';
	
	config.height="500px";
	//Toolbar
	config.toolbar_Full =
		[
		    { name: 'document',    items : [ 'Source','-','DocProps','Preview','Print','-','Templates' ] },
		    { name: 'clipboard',   items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
		    { name: 'editing',     items : [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] },
		    { name: 'forms',       items : [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
		    '/',
		    { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
		    { name: 'paragraph',   items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },
		    { name: 'links',       items : [ 'Link','Unlink','Anchor' ] },
		    { name: 'insert',      items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','-','insertcode' ] },
		    '/',
		    { name: 'styles',      items : [ 'Styles','Format','Font','FontSize' ] },
		    { name: 'colors',      items : [ 'TextColor','BGColor' ] },
		    { name: 'tools',       items : [ 'Maximize', 'ShowBlocks' ] }
		];
	
	
	// 璁剧疆蹇嵎閿�浠庝笂寰�笅渚濇鏄細鑾峰彇鐒︾偣锛屽厓绱犵劍鐐癸紝鏂囨湰鑿滃崟锛屾挙閿�紝閲嶅仛锛岄噸鍋氾紝閾炬帴锛岀矖浣擄紝鏂滀綋锛屼笅鍒掔嚎
	config.keystrokes = [ [ CKEDITOR.ALT + 121, 'toolbarFocus' ],
			[ CKEDITOR.ALT + 122, 'elementsPathFocus' ],
			[ CKEDITOR.SHIFT + 121, 'contextMenu' ],
			[ CKEDITOR.CTRL + 90, 'undo' ], [ CKEDITOR.CTRL + 89, 'redo' ],
			[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 90, 'redo' ],
			[ CKEDITOR.CTRL + 76, 'link' ], [ CKEDITOR.CTRL + 66, 'bold' ],
			[ CKEDITOR.CTRL + 73, 'italic' ],
			[ CKEDITOR.CTRL + 85, 'underline' ],
			[ CKEDITOR.ALT + 109, 'toolbarCollapse' ] ]
	// 璁剧疆蹇嵎閿�鍙兘涓庢祻瑙堝櫒蹇嵎閿啿绐�plugins/keystrokes/plugin.js.
	config.blockedKeystrokes = [ CKEDITOR.CTRL + 66, CKEDITOR.CTRL + 73,
			CKEDITOR.CTRL + 85 ]
	// 璁剧疆缂栬緫鍐呭厓绱犵殑鑳屾櫙鑹茬殑鍙栧� plugins/colorbutton/plugin.js.
	config.colorButton_backStyle = {
		element : 'span',
		styles : {
			'background-color' : '#(color)'
		}
	}
	// 鏄惁鍦ㄩ�鎷╅鑹叉椂鏄剧ず鈥滃叾瀹冮鑹测�閫夐」 plugins/colorbutton/plugin.js
	config.colorButton_enableMore = false
	// 鍖哄潡鐨勫墠鏅壊榛樿鍊艰缃�plugins/colorbutton/plugin.js
	config.colorButton_foreStyle = {
		element : 'span',
		styles : {
			'color' : '#(color)'
		}
	};
	// 鎵�渶瑕佹坊鍔犵殑CSS鏂囦欢 鍦ㄦ娣诲姞 鍙娇鐢ㄧ浉瀵硅矾寰勫拰缃戠珯鐨勭粷瀵硅矾寰�
	//config.contentsCss = 'style/public.css';
	// 鏂囧瓧鏂瑰悜
	config.contentsLangDirection = 'ltr';// 浠庡乏鍒板彸
};

CKEDITOR.on( 'instanceReady', function( ev ){  
    with (ev.editor.dataProcessor.writer) {  
      setRules("p",  {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("h1", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("h2", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("h3", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("h4", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("h5", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("div", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("table", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("tr", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("td", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("iframe", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("li", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("ul", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
      setRules("ol", {indent : false, breakBeforeOpen : false, breakAfterOpen : false, breakBeforeClose : false, breakAfterClose : false} );  
    }  
  
}) ;

